<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="16dp"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_margin="32dp"
        android:background="@drawable/input_text"
        android:gravity="right|center_vertical"
        android:paddingLeft="8dp"
        android:paddingTop="8dp"
        android:paddingRight="16dp"
        android:paddingBottom="16dp"
        android:text="123456789"
        android:textSize="32sp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/text"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal">

            <Button
                android:id="@+id/seven"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="7" />

            <Button
                android:id="@+id/eight"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="8" />

            <Button
                android:id="@+id/nine"
                style="@style/calc_button"

                android:layout_width="0dp"
                android:text="9" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal">

            <Button
                android:id="@+id/four"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="4" />

            <Button
                android:id="@+id/five"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="5" />

            <Button
                android:id="@+id/six"
                style="@style/calc_button"
                android:text="6" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal">

            <Button
                android:id="@+id/one"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="1" />

            <Button
                android:id="@+id/two"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="2" />

            <Button
                android:id="@+id/three"
                style="@style/calc_button"
                android:text="3" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal">

            <View
                style="@style/calc_button"
                android:visibility="invisible" />

            <Button
                android:id="@+id/zero"
                style="@style/calc_button"
                android:text="0" />

            <View
                style="@style/calc_button"
                android:visibility="invisible" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal">

            <View
                style="@style/calc_button"
                android:visibility="invisible" />

            <View
                style="@style/calc_button"
                android:visibility="invisible"></View>

            <View
                style="@style/calc_button"
                android:visibility="invisible"></View>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal">

            <Button
                android:id="@+id/plus"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="+" />

            <Button
                android:id="@+id/minus"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="-" />

            <Button
                android:id="@+id/equals"
                style="@style/calc_button"
                android:text="=" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal">

            <Button
                android:id="@+id/multiply"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="*" />

            <Button
                android:id="@+id/division"
                style="@style/calc_button"
                android:layout_marginRight="5dp"
                android:text="/" />

            <Button
                android:id="@+id/reset"
                style="@style/calc_button"
                android:text="C" />
        </LinearLayout>
    </LinearLayout>

</RelativeLayout>